<template>
  <section>
    <div id="logStr" v-html="logStr"></div>
  </section>
</template>


<script>
  import dao from '../../common/dao'
  import util from '../../common/util'
  export default {
    components: {},
    data() {
      return {
        html: '',
        logStr: '',
        query:{}
      }
    },
    methods: {
      getLogF(){
        let parm = this.query.parm.replace(/"/g,'');
        let node = this.query.node;
        let uri = `http://${node}${parm}`
        dao.getYarnLogByFullPath({uri}).then(res => {
          if (res.FX.err) return false
          let html = res.body.results||"";
          this.logStr = html
        })
      },
      getLog(){
        let parm = this.query.parm.replace(/"/g,'');
        dao.getFullTrackingLog( {uri:parm}).then(res => {
          if (res.FX.err) return false
          let html = res.body.results||"";
          this.logStr = html
        })
      }
    },
    mounted: function () {
      this.query = this.$store.state.route.query || {};
      (this.query.node)? this.getLogF():this.getLog()
    }
  }
</script>

<style scoped>

</style>